//
//  LoginController.swift
//  NavigationControl
//
//  Created by ap0stader on 2023/11/21.
//

import UIKit

class LoginViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        NotificationCenter.default.addObserver(self, selector: #selector(autoFillInformation), name: Notification.Name("RegisterSubmitNotification"), object: nil)
    }

    @IBOutlet var studentid: UITextField!
    
    @IBOutlet var password: UITextField!
    
    @objc func autoFillInformation(notification: Notification) {
        let studentInfo = notification.userInfo!
        let thestudentId = studentInfo["ID"] as! String
        let thepassword = studentInfo["password"] as! String
        studentid.text = thestudentId
        password.text = thepassword
    }

    @IBAction func dismisskeyboard(_ sender: UITapGestureRecognizer) {
        studentid.resignFirstResponder()
        password.resignFirstResponder()
    }
    
}
